#define _CRT_SECURE_NO_WARNINGS 2
#include"heap.h"

int main() {
	Heap  php;
	HeapInit(&php);
	int arr[] = { 12,100,33,88,77,66,55,99, 22 };
	int len = sizeof(arr) / sizeof(arr[0]);
	for (int i = 0; i < 9; i++) {
		HeapAdd(&php, arr[i]);
	}
	
	for (int i = 0; i < php.size; i++) {
		printf("%d ", php.arr[i]);
	}
	putchar('\n');

	HeapPop(&php);
	for (int i = 0; i < php.size; i++) {
		printf("%d ", php.arr[i]);
	}
	putchar('\n');
	printf("%d\n", HeapSize(&php));

	int arr1[] = { 12,22,33,88,77,66,55,99,100 };
	int len1 = sizeof(arr) / sizeof(arr[0]);

	printf("use adjust down to create heap and print\n");
	HeapSort(arr1, len1);
	for (int i = 0; i < len1; i++) {
		printf("%d ", arr1[i]);
	}
	putchar('\n');
	HeapDestroy(&php);
	 
	return 0;
}